/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.krazevina.kar;

import com.sun.lwuit.Display;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;

public class Main extends MIDlet{
    MainForm form;
    Help help;
    FirstForm ff;
    
    private static Main m;
    private static About a;
    
    protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
    }

    protected void pauseApp() {
    }

    protected void startApp() throws MIDletStateChangeException {
        m = this;
        Display.init(this);
        form = new MainForm();
        showFirst();
    }
    public void showMain(){
        if(form==null)form = new MainForm();
        MainForm.lastSearch = "a";
        form.show();
    }
    public void showHelp(){
        if(help==null)help = new Help();
        help.show();
    }
    public void showFirst(){
        if(ff==null)ff = new FirstForm();
        ff.show();
    }
    public void showAbout(){
        if(a==null)a = new About();
        a.show();
    }
    public static Main getInstance(){
        return m;
    }
}
